<template>
  <div>
    <!-- 三级分类导航 -->
    <TypeNav :isListHidden="false" />
    <!-- 列表 -->
    <ListContainer />
    <!-- 今日推荐 -->
    <Recommend />
    <!-- 商品排行 -->
    <Rank />
    <!-- 喜欢 -->
    <Like />
    <!-- 楼层 -->
    <div v-if="floorInfos.length">
      <Floor
        v-for="floorInfo in floorInfos"
        :key="floorInfo.id"
        :floorInfo="floorInfo"
      />
    </div>
    <!-- 商标 -->
    <Brand />
  </div>
</template>

<script>
import { reqGetMockFloorInfo } from '@/api/homeAPI'

import Brand from './Brand'
import Floor from './Floor'
import Like from './Like'
import ListContainer from './ListContainer'
import Rank from './Rank'
import Recommend from './Recommend'
import TypeNav from '@/components/TypeNav'

export default {
  name: 'ZHome',
  data() {
    return {
      floorInfos: [],
    }
  },
  components: {
    TypeNav,
    ListContainer,
    Recommend,
    Floor,
    Like,
    Brand,
    Rank,
  },
  async mounted() {
    const res = await reqGetMockFloorInfo()
    this.floorInfos = res
  },
}
</script>

<style></style>
